package com.wicket.okrframework.web.contorller;

import com.github.pagehelper.Page;
import com.wicket.okrframework.biz.service.BatchService;
import com.wicket.okrframework.biz.service.dto.req.*;
import com.wicket.okrframework.biz.service.dto.res.*;
import com.wicket.okrframework.common.ro.OkrResult;
import com.wicket.okrframework.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/base/batch/")
public class BatchController {

    @Autowired
    BatchService batchService;



    /**
   * D1-1查询底层框架服务批次列表
   */
    @PostMapping("queryBaseBatchList")
    public OkrResult<QueryBaseBatchListRespDto> queryBaseBatchList(@RequestBody @Validated QueryBaseBatchListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryBaseBatchListRespDto retData = batchService.queryBaseBatchList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-1新增底层框架服务批次
   */
    @PostMapping("addBaseBatch")
    public OkrResult<AddBaseBatchRespDto> addBaseBatch(@RequestBody @Validated AddBaseBatchReqDto reqDTO){
    return OkrResult.success(batchService.addBaseBatch(reqDTO));
    }

    /**
   * D1-1查询底层框架服务批次详情
   */
    @PostMapping("queryBaseBatchDetail")
    public OkrResult<QueryBaseBatchDetailRespDto> queryBaseBatchDetail(@RequestBody @Validated QueryBaseBatchDetailReqDto reqDTO){
    return OkrResult.success(batchService.queryBaseBatchDetail(reqDTO));
    }
/**
   * D1-1撤销修订组织架构底层批次自身处理(公共)
   */
    @PostMapping("undoReviseOrgBaseBatchOwnHandleCom")
    public OkrResult<UndoReviseOrgBaseBatchOwnHandleComRespDto> undoReviseOrgBaseBatchOwnHandleCom(@RequestBody @Validated UndoReviseOrgBaseBatchOwnHandleComReqDto reqDTO){
    return OkrResult.success(batchService.undoReviseOrgBaseBatchOwnHandleCom(reqDTO));
    }
/**
   * D1-1发布组织架构底层批次自身处理(公共)
   */
    @PostMapping("releaseOrgBaseBatchOwnHandleCom")
    public OkrResult<ReleaseOrgBaseBatchOwnHandleComRespDto> releaseOrgBaseBatchOwnHandleCom(@RequestBody @Validated ReleaseOrgBaseBatchOwnHandleComReqDto reqDTO){
    return OkrResult.success(batchService.releaseOrgBaseBatchOwnHandleCom(reqDTO));
    }
/**
   * D1-1撤销组织架构成员基础批次处理(公共)
   */
    @PostMapping("undoOrgBaseBatchProcessingCom")
    public OkrResult<UndoOrgBaseBatchProcessingComRespDto> undoOrgBaseBatchProcessingCom(@RequestBody @Validated UndoOrgBaseBatchProcessingComReqDto reqDTO){
    return OkrResult.success(batchService.undoOrgBaseBatchProcessingCom(reqDTO));
    }
/**
   * D1-1发布组织架构成员基础批次处理(公共)
   */
    @PostMapping("releaseOrgBaseBatchProcessingCom")
    public OkrResult<ReleaseOrgBaseBatchProcessingComRespDto> releaseOrgBaseBatchProcessingCom(@RequestBody @Validated ReleaseOrgBaseBatchProcessingComReqDto reqDTO){
    return OkrResult.success(batchService.releaseOrgBaseBatchProcessingCom(reqDTO));
    }
/**
   * D1-3撤销就职记录相关批次处理(公共)
   */
    @PostMapping("undoInductionRecordBatchProcessingCom")
    public OkrResult<UndoInductionRecordBatchProcessingComRespDto> undoInductionRecordBatchProcessingCom(@RequestBody @Validated UndoInductionRecordBatchProcessingComReqDto reqDTO){
    return OkrResult.success(batchService.undoInductionRecordBatchProcessingCom(reqDTO));
    }
/**
   * D1-3发布就职记录相关批次处理(公共)
   */
    @PostMapping("releaseInductionRecordBatchProcessingCom")
    public OkrResult<ReleaseInductionRecordBatchProcessingComRespDto> releaseInductionRecordBatchProcessingCom(@RequestBody @Validated ReleaseInductionRecordBatchProcessingComReqDto reqDTO){
    return OkrResult.success(batchService.releaseInductionRecordBatchProcessingCom(reqDTO));
    }
/**
   * D1-3更新组织架构成员批次处理进度(公共)
   */
    @PostMapping("refreshMemberBatchProgressCom")
    public OkrResult<RefreshMemberBatchProgressComRespDto> refreshMemberBatchProgressCom(@RequestBody @Validated RefreshMemberBatchProgressComReqDto reqDTO){
    return OkrResult.success(batchService.refreshMemberBatchProgressCom(reqDTO));
    }
/**
   * D1执行组织架构批次发布
   */
    @PostMapping("implementOrgBatchPublish")
    public OkrResult<ImplementOrgBatchPublishRespDto> implementOrgBatchPublish(@RequestBody @Validated ImplementOrgBatchPublishReqDto reqDTO){
    return OkrResult.success(batchService.implementOrgBatchPublish(reqDTO));
    }
/**
   * D1执行组织架构撤销批次
   */
    @PostMapping("implementOrgDeleteBatch")
    public OkrResult<ImplementOrgDeleteBatchRespDto> implementOrgDeleteBatch(@RequestBody @Validated ImplementOrgDeleteBatchReqDto reqDTO){
    return OkrResult.success(batchService.implementOrgDeleteBatch(reqDTO));
    }

    /**
   * D1判断组织架构进入管理可用(公共)
   */
    @PostMapping("judgeOrgStructureMgtUsableCom")
    public OkrResult<JudgeOrgStructureMgtUsableComRespDto> judgeOrgStructureMgtUsableCom(@RequestBody @Validated JudgeOrgStructureMgtUsableComReqDto reqDTO){
    return OkrResult.success(batchService.judgeOrgStructureMgtUsableCom(reqDTO));
    }

    /**
   * D1-1新增组织批次
   */
    @PostMapping("addOrgBatch")
    public OkrResult<AddOrgBatchRespDto> addOrgBatch(@RequestBody @Validated AddOrgBatchReqDto reqDTO){
    return OkrResult.success(batchService.addOrgBatch(reqDTO));
    }
/**
   * D1-3判断发起组织批次操作可用(公共)
   */
    @PostMapping("judgeInitiateOrgBatchUsableCom")
    public OkrResult<JudgeInitiateOrgBatchUsableComRespDto> judgeInitiateOrgBatchUsableCom(@RequestBody @Validated JudgeInitiateOrgBatchUsableComReqDto reqDTO){
    return OkrResult.success(batchService.judgeInitiateOrgBatchUsableCom(reqDTO));
    }
/**
   * 1111D1-1发布底层框架服务批次	
   */
    @PostMapping("releaseBaseBatch")
    public OkrResult<ReleaseBaseBatchRespDto> releaseBaseBatch(@RequestBody @Validated ReleaseBaseBatchReqDto reqDTO){
    return OkrResult.success(batchService.releaseBaseBatch(reqDTO));
    }
/**
   * 1111D1-1删除底层框架服务批次
   */
    @PostMapping("deleteBaseBatch")
    public OkrResult<DeleteBaseBatchRespDto> deleteBaseBatch(@RequestBody @Validated DeleteBaseBatchReqDto reqDTO){
    return OkrResult.success(batchService.deleteBaseBatch(reqDTO));
    }
/**
   * D1执行生命周期判断(公共)
   */
    @PostMapping("implementLifeCycleJudgmentCom")
    public OkrResult<ImplementLifeCycleJudgmentComRespDto> implementLifeCycleJudgmentCom(@RequestBody @Validated ImplementLifeCycleJudgmentComReqDto reqDTO){
    return OkrResult.success(batchService.implementLifeCycleJudgmentCom(reqDTO));
    }


}
